package com.micaelvesterlund.skeerkie.shared.domain;

import java.util.List;

public class Team {
	private City city;
	private Name name;
	private List<Player> players;

	public Team(City city, Name name, List<Player> players) {
		this.city = city;
		this.name = name;
		this.players = players;
	}

	public List<Player> getPlayers() {
		return players;
	}

	public Name getName() {
		return name;
	}

	public City getCity() {
		return city;
	}

	@Override
	public String toString() {
		return "Team [city=" + city + ", name=" + name + ", players=" + players
				+ "]";
	}

	// TODO use ID?
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Team other = (Team) obj;
		if (city == null) {
			if (other.city != null)
				return false;
		} else if (!city.equals(other.city))
			return false;
		return true;
	}

}
